package com.fivefu.core.hik.controller;

import com.fivefu.base.web.controller.BaseController;
import com.fivefu.base.web.vo.ResultInfo;
import com.fivefu.core.hik.services.HikVehicleCameraService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 海康车辆监控点关联表 前端控制器
 * </p>
 *
 * @author 
 * @since 2022-09-01 18:03:33
 */
@Api(tags = "车辆与监控点的关联")
@RestController
@RequestMapping("/vehicleCamera")
public class DbHikVehicleCameraController extends BaseController {

    private final Logger logger = LoggerFactory.getLogger(DbHikVehicleCameraController.class);

    @Resource
    private HikVehicleCameraService hikVehicleCameraService;

    @ApiOperation(value = "根据车辆编号与设备编号获取监控点信息列表V1",httpMethod = "POST",response = ResultInfo.class,notes = "查询车辆信息列表v1")
    @RequestMapping(path = "/vehicleMonitoring",method = RequestMethod.POST)
    public ResultInfo vehicleMonitoring () {
        try {
            hikVehicleCameraService.searchMonitoryPoint();
            return ResultInfo.renderSuccess("根据车辆编号与设备编号获取监控点信息列表V1成功");
        } catch (Exception e) {
            logger.error("根据车辆编号与设备编号获取监控点信息列表V1出现异常" + e.getMessage(),e);
            return ResultInfo.renderError("根据车辆编号与设备编号获取监控点信息列表V1失败");
        }
    }

}
